Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set camera to unavailable when camera fps == 0 #526

Merged
merged 5 commits into from
Aug 26, 2023

Conversation

NickM-27
Copy link
Collaborator

No description provided.

@NickM-27 NickM-27 marked this pull request as draft August 10, 2023 21:07
@NickM-27 NickM-27 marked this pull request as ready for review August 10, 2023 21:10
@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Merging #526 (701daaf) into dev (a0d1834) will not change coverage.
Report is 1 commits behind head on dev.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##               dev      #526   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        15           
  Lines         1941      1952   +11     
=========================================
+ Hits          1941      1952   +11     
Files Changed Coverage Δ
custom_components/frigate/__init__.py 100.00% <100.00%> (ø)
custom_components/frigate/camera.py 100.00% <100.00%> (ø)

@NickM-27
Copy link
Collaborator Author

Closes #406

@dermotduffy dermotduffy added the enhancement New feature or request label Aug 11, 2023
@dermotduffy
Copy link
Collaborator

Looks good:

  • I bet that multi-line return method is reducible to a single line and still relatively readable, e.g: (not-tested) return self.coordinator.get('data', {}).get(self._cam_name, {}).get("camera_fps", 0) != 0
  • Mind adding a test to verify the unavailable behavior?

@NickM-27
Copy link
Collaborator Author

Looks good:

  • I bet that multi-line return method is reducible to a single line and still relatively readable, e.g: (not-tested) return self.coordinator.get('data', {}).get(self._cam_name, {}).get("camera_fps", 0) != 0
  • Mind adding a test to verify the unavailable behavior?

Yeah I was mainly just wanting to fit the existing structure since I wasn't sure if there were other reasons for it. That should be fine though 👍

@NickM-27 NickM-27 force-pushed the unavailable branch 2 times, most recently from 58725de to 98b4950 Compare August 11, 2023 13:59
@NickM-27
Copy link
Collaborator Author

NickM-27 commented Aug 11, 2023

@dermotduffy it makes no sense why this doesn't work, it works in HASS when I test with my cameras

Screen Shot 2023-08-11 at 07 57 29 AM

the only thing I can say is that there seems to be a slight delay from when it goes available//unavailable that is longer than the sync_interval

@NickM-27
Copy link
Collaborator Author

@dermotduffy Do you have any suggestions? It works as expected in HA, wondering if the unavailable check doesn't work in the tests for some reason

@dermotduffy
Copy link
Collaborator

dermotduffy commented Aug 26, 2023

@NickM-27 It was a combination of a test issue that you'll kick yourself over (not passing the test client), and a nasty (and real) multiple inheritance bug that maybe you should kick me over ;-)

@NickM-27
Copy link
Collaborator Author

Ah that'll do it, thank you!

@dermotduffy dermotduffy merged commit d78b803 into blakeblackshear:dev Aug 26, 2023
6 checks passed
@dermotduffy
Copy link
Collaborator

Thanks @NickM-27 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants